import { useChatStore } from "@/stores/modules/chat.ts";
import type { Chat } from "@/types/chat.ts";

export function useChat() {
  const chatStore = useChatStore();

  const addChat = (uuid: number, chat: Chat) => {
    chatStore.addChatByUuid(uuid, chat);
  };

  const updateChat = (uuid: number, index: number, chat: Chat) => {
    chatStore.updateChatByUuid(uuid, index, chat);
  };

  return {
    addChat,
    updateChat,
  };
}
